using System;

namespace IBNet
{
   /// <summary>
   /// News Event Arguments
   /// </summary>
   public class NewsEventArgs : EventArgs
   {
      private readonly int messageId;
      private readonly NewsType messageType;
      private readonly string message;
      private readonly string originatingExchange;

      /// <summary>
      /// Full Constructor
      /// </summary>
      /// <param name="msgId">The bulletin ID, incrementing for each new bulletin.</param>
      /// <param name="msgType">Specifies the type of bulletin.</param>
      /// <param name="message">The bulletin's message text.</param>
      /// <param name="originExchange">The exchange from which this message originated.</param>
      public NewsEventArgs(int msgId, NewsType msgType, string message, string originExchange)
      {
         this.messageId = msgId;
         this.message = message;
         this.messageType = msgType;
         this.originatingExchange = originExchange;
      }

      /// <summary>
      /// Gets the message Id. Incremented for each news bulletin.
      /// </summary>
      public int MessageId
      {
         get { return messageId; }
      }

      /// <summary>
      /// Gets the message type.
      /// </summary>
      public NewsType MessageType
      {
         get { return messageType; }
      }

      /// <summary>
      /// Gets the news message.
      /// </summary>
      public string Message
      {
         get { return message; }
      }

      /// <summary>
      /// Gets the exchange from which this message originated.
      /// </summary>
      public string OriginatingExchange
      {
         get { return originatingExchange; }
      }
   }
}